﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="ontheroad.intsignlist"
	SupportedOrientations="Portrait" Orientation="Portrait"
	shell:SystemTray.IsVisible="False">

	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="cctvviewbut" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<StackPanel>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="cctvthtxt" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<TextBlock x:Name="cctvthtxt" TextWrapping="Wrap" Text="ถ.ศรีอยุธยา แยกพญาไท - แยกศรีอยุธยา หน้าศูนย์เทคโนโลยีทางการศึกษากรมการศึกษานอกโรงเรียน" FontSize="34.667" LineStackingStrategy="BlockLineHeight" LineHeight="32"/>
							<TextBlock x:Name="cctventxt" TextWrapping="Wrap" Text="BMA0016" FontFamily="Segoe WP SemiLight" FontSize="18.667" FontWeight="Bold" Margin="0,-10,0,0">
								<TextBlock.Foreground>
									<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
								</TextBlock.Foreground>
							</TextBlock>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK"/>
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="FontSize" Value="48"/>
			<Setter Property="Foreground" Value="Black"/>
		</Style>
		<DataTemplate x:Key="DataTemplate1">
			<StackPanel x:Name="TitlePanel" Margin="0">
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
					<TextBlock TextWrapping="Wrap" Text="on" FontFamily="Segoe WP SemiLight" HorizontalAlignment="Right" FontSize="24" VerticalAlignment="Center" FontWeight="Bold" Margin="0">
						<TextBlock.Foreground>
							<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
						</TextBlock.Foreground>
					</TextBlock>
					<TextBlock TextWrapping="Wrap" Text="theroad" VerticalAlignment="Center" FontFamily="Segoe WP" FontSize="24" Margin="0" FontWeight="Bold" d:LayoutOverrides="Width" HorizontalAlignment="Left">
						<TextBlock.Foreground>
							<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
						</TextBlock.Foreground>
					</TextBlock>
					<TextBlock TextWrapping="Wrap" Text=".cctv" VerticalAlignment="Center" FontFamily="Segoe WP" FontSize="24" Margin="0" FontWeight="Bold" HorizontalAlignment="Left" Foreground="Black"/>
				</StackPanel>
			</StackPanel>
		</DataTemplate>
		<DataTemplate x:Key="DataTemplate2">
			<StackPanel x:Name="TitlePanel" Margin="0">
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
					<TextBlock TextWrapping="Wrap" Text="INTELLIGENT TRAFFIC SIGNS" VerticalAlignment="Center" FontFamily="Segoe WP Semibold" FontSize="21.333" Margin="0" HorizontalAlignment="Left" FontWeight="Bold">
						<TextBlock.Foreground>
							<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
						</TextBlock.Foreground>
					</TextBlock>
				</StackPanel>
			</StackPanel>
		</DataTemplate>
		<ControlTemplate x:Key="PhoneDisabledTextBoxTemplate" TargetType="TextBox">
			<ContentControl x:Name="ContentElement" BorderThickness="0" HorizontalContentAlignment="Stretch" Margin="{StaticResource PhoneTextBoxInnerMargin}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="Stretch"/>
		</ControlTemplate>
		<Style x:Key="TextBoxStyle1" TargetType="TextBox">
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
			<Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
			<Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
			<Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
			<Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}"/>
			<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
			<Setter Property="Padding" Value="2"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="TextBox">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOrReadonlyBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="ReadOnly">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledOrReadonlyBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DisabledOrReadonlyBorder">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="DisabledOrReadonlyBorder">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DisabledOrReadonlyContent">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused">
										<Storyboard>
											<ColorAnimation Duration="0" To="{StaticResource PhoneAccentColor}" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="EnabledBorder" d:IsOptimized="True"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="EnabledBorder">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Thickness>1</Thickness>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unfocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="EnabledBorder" Background="#FFF3F3F3" BorderBrush="Black">
								<ContentControl x:Name="ContentElement" BorderThickness="0" HorizontalContentAlignment="Stretch" Margin="{StaticResource PhoneTextBoxInnerMargin}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="Stretch" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="29.333" FontWeight="Bold"/>
							</Border>
							<Border x:Name="DisabledOrReadonlyBorder" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}" Visibility="Collapsed">
								<TextBox x:Name="DisabledOrReadonlyContent" Background="Transparent" Foreground="{StaticResource PhoneDisabledBrush}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" IsReadOnly="True" SelectionForeground="{TemplateBinding SelectionForeground}" SelectionBackground="{TemplateBinding SelectionBackground}" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}" Text="{TemplateBinding Text}" Template="{StaticResource PhoneDisabledTextBoxTemplate}"/>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="PivotStyle1" TargetType="controls:Pivot">
			<Setter Property="Margin" Value="0"/>
			<Setter Property="Padding" Value="0"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="ItemsPanel">
				<Setter.Value>
					<ItemsPanelTemplate>
						<Grid/>
					</ItemsPanelTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="controls:Pivot">
						<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache" Grid.RowSpan="3"/>
							<ContentPresenter ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" Margin="24,10,0,-7"/>
							<controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1"/>
							<ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<Grid x:Name="LayoutRoot" Background="White">
		<!--Pivot Control-->
		<controls:Pivot Title="MY APPLICATION" Foreground="Black" TitleTemplate="{StaticResource DataTemplate2}" Style="{StaticResource PivotStyle1}">
			<!--Pivot item one-->
			<controls:PivotItem Header="favorites" Margin="20,8,12,0">
				<Grid>
					<ListBox x:Name="cctvfavlistbox" BorderThickness="0" Margin="5,0,0,0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0" Width="443" Orientation="Horizontal">
                                    <Grid Margin="0" Width="405" VerticalAlignment="Top">
                                        <Button x:Name="viewfavintsignbut" Tag="{Binding vmsNo}" Content="" Style="{StaticResource intsignselectbut}" Margin="0,0,0,8" Click="viewintsignbut_Click">
                                            <i:Interaction.Triggers>
                                                <i:EventTrigger EventName="Click">
                                                    <ic:NavigateToPageAction TargetPage="/imgresultpage.xaml"/>
                                                </i:EventTrigger>
                                            </i:Interaction.Triggers>
                                        </Button>
                                    </Grid>
                                    <Image x:Name="delfavbut" Tag="{Binding vmsNo}" Margin="10,15,0,0" Source="icons/appbar.delete.smal.dark.png" Stretch="Fill" Width="18" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" MouseLeftButtonDown="delfavbut_MouseLeftButtonDown"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
					<Canvas x:Name="noticeMsgFav" Margin="0,120,0,0" Height="185" VerticalAlignment="Top">
						<TextBlock TextWrapping="Wrap" Text="ไม่มีรายการโปรด" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="34.667" FontWeight="Bold" Canvas.Left="140" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Top="105"/>
						<TextBlock TextWrapping="Wrap" Text="there isn't a favorite sign." FontFamily="Segoe WP SemiLight" FontSize="40" FontWeight="Bold" Canvas.Left="7" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Top="52">
							<TextBlock.Foreground>
								<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
							</TextBlock.Foreground>
						</TextBlock>
					</Canvas>
				</Grid>
			</controls:PivotItem>

 			<!--Pivot item two-->
			<controls:PivotItem Header="all" Margin="20,0,12,0">
				<Grid>
					<ListBox x:Name="cctvlistbox" BorderThickness="0" Margin="5,57,0,0" Padding="0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Button x:Name="viewintsignbut7" Tag="{Binding vmsNo}" Content="" Style="{StaticResource intsignselectbut}" Margin="0,0,0,8" Click="viewintsignbut_Click"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
					<toolkit:AutoCompleteBox x:Name="searchintsigntxtbox" VerticalAlignment="Top" Height="48" Margin="5,5,65,0" Width="378" Background="#BF000000" BorderThickness="0" TextBoxStyle="{StaticResource TextBoxStyle1}" FontFamily="/ontheroad;component/Fonts/Fonts.zip#TH SarabunPSK" FontSize="29.333" KeyUp="searchintsigntxtbox_KeyUp"/>
					<Button x:Name="searchintsignbut"  Content="Button" Height="48" Style="{StaticResource searchroadbut}" Width="48" Click="searchintsignbut_Click" HorizontalAlignment="Right" Margin="0,5,17,0" VerticalAlignment="Top"/>
				</Grid>
			</controls:PivotItem>
		</controls:Pivot>
		<Grid x:Name="waitScr" Background="#CC000000" d:IsHidden="True">
			<ProgressBar Height="30" VerticalAlignment="Center" IsIndeterminate="True" Margin="0"/>
		</Grid>
	</Grid>
</phone:PhoneApplicationPage>